<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
    <div id="app">
        firstName:<input type="text" placeholder="请输入名" v-model="firstName">
    </div>
</body>
<script src="./js/vue.js"></script>
<script>
    Vue.config.productionTip = false;

    var vm = new Vue({
        el:"#app",
        data:{
            firstName:"T"
        },
       /* watch:{
            //监听firstName的改变
            firstName(newval,oldval){
                console.log("watch - firstName",newval,oldval)
            }
        }*/
    })
    vm.$watch("firstName",(newval,oldval)=>{
        console.log("watch - firstName",newval,oldval)
    })
</script>
</html>